package crowx.android.AndCellTrack;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;

class BtsOverlay extends Overlay {
	private GeoPoint point;
	
	public BtsOverlay(double latitude, double longitude) {
		point = new GeoPoint((int)(latitude * 1E6),(int)(longitude * 1E6));
	}
	
	public BtsOverlay(double[] pos) {
		point = new GeoPoint((int)(pos[0] * 1E6),(int)(pos[1] * 1E6));
	}
	
	@Override
    public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) {
        super.draw(canvas, mapView, shadow);                   

        //---translate the GeoPoint to screen pixels---
        Point screenPts = new Point();
        mapView.getProjection().toPixels(point, screenPts);

        //---add the marker---
        Paint paint = new Paint();
        paint.setARGB(255, 0, 200, 0);
        
        Paint paint2 = new Paint();
        paint2.setARGB(30, 200, 0, 0);
        
        //canvas.drawCircle(screenPts.x, screenPts.y, 8.0f, paint);
        canvas.drawCircle(screenPts.x, screenPts.y, 6.0f, paint2);
        canvas.drawCircle(screenPts.x, screenPts.y, 3.0f, paint);
        //canvas.drawPoint(screenPts.x, screenPts.y, paint);
        return true;
    }
}
